package LibraryDemo.Dao;

import LibraryDemo.InvalidBookException;
import LibraryDemo.Entity.*;

public class MockBookDao implements IBookDao{
	public Book fetchBook(int bookId){
		Book b = new Book();
		b.setBookId(bookId);
		b.setBookName("Book" + bookId);
		return b;
	}
	public void persistBook(Book book) {
		System.out.println("book id is saved..." + book.getBookId());
		System.out.println("book name is saved..." + book.getBookName());
	}
	public void updateBook(Book book) throws InvalidBookException{
		if (book.getBookId() <= 0)
			throw new InvalidBookException("book id is invalid...");
		System.out.println("book id is updated..." + book.getBookId());
		System.out.println("book name is updated..." + book.getBookName());
	}
	public void deleteBook(int bookId){
		System.out.println("book id is deleted..." + bookId);
	}
}
